#include "gtest/gtest.h"
#include "library2/liblog.h"
#include <ctime>

using namespace basic::library2;
class LogTest : public ::testing::Test {
public:
    LogTest():ol1(),ol2()
    {
        ol1.Init("test_data/ol1", CLog::L_DEBUG, 10, CLog::ROTE_BY_SIZE, 1000);
        
        ol2.Init("test_data/ol2", CLog::L_ERROR, 10, CLog::ROTE_BY_SIZE, 2000);
//        ol2.SetVerbose(true);
    }
protected:
    CLog ol1,ol2;
};

TEST_F(LogTest, OverAllTest)
{
    for(apr_int32_t i = 0; i < 1000; i++)
    {
        ol1.LogDebug("Debug %l", time(NULL));
        ol1.LogNotice("Notice %l", time(NULL));
        ol1.LogError("Error %l", time(NULL));
        ol1.Log(CLog::L_INFO, "CLog::L_INFO %l", time(NULL));
        
        ol2.LogDebug("Debug %l", time(NULL));
        ol2.LogNotice("Notice %l", time(NULL));
        ol2.LogError("Error %l", time(NULL));
        ol2.Log(CLog::L_ALERT, "CLog::L_ALERT %l", time(NULL));
    }
}
